package org.example.userservice.impl;

import org.example.mapper.SalelogMapper;
import org.example.pojo.entity.SaleLog;
import org.example.userservice.SaleLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class SaleLogServiceImpl implements SaleLogService {

    @Autowired
    private SalelogMapper salelogMapper;

    @Override
    public void insertSaleLog(SaleLog saleLog) {
        saleLog.setSaletime(LocalDateTime.now());
        salelogMapper.insertSaleLog(saleLog);
    }

    @Override
    public void buySaleLog(SaleLog saleLog) {
        salelogMapper.buySaleLog(saleLog);
    }

    @Override
    public void cancelSaleLog(SaleLog saleLog) {
        salelogMapper.cancelSaleLog(saleLog);
    }
}
